<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/image-validate-code" prefix="img" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>用户登录</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="static/login/skin/style.css" rel="stylesheet" type="text/css" id="skin"/>
	<script type="text/javascript" src="libs/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="libs/js/login.js"></script>
	<!--居中显示start-->
	<script type="text/javascript" src="libs/js/method/center-plugin.js"></script>
	<!--居中显示end-->
	<style type="text/css">
	/*提示信息*/	
	#cursorMessageDiv {position: absolute;z-index: 99999;border: solid 1px #cc9933;background: #ffffcc;padding: 2px;margin: 0px;display: none;line-height:150%;}
	/*提示信息*/
	</style>
  </head>
  <body>
    <div class="login_main">
		<div class="login_top"></div>
		<div class="login_middle">
			<div class="login_middleleft"></div>
			<div class="login_middlecenter">
				<form id="loginForm" action="j_spring_security_check" class="login_form" method="post">
					<div class="login_user"><input type="text" id="username" name="j_username"/></div>
					<div class="login_pass"><input type="password" id="password" name="j_password"/></div>
					<div class="login_pass">
						<input type="text" name="j_validCode" id="validCode" style="width: 100px"/>
						<span style="position: absolute;"><img:validcode action="validCode"/></span>
					</div>
					<div class="clear"></div>
					<div class="login_button">
						<div class="login_button_left"><input type="button" onclick="login()"/></div>
						<div class="login_button_right"><input type="reset" value=""/></div>
						<div class="clear"></div>
					</div>
				</form>
				<div class="login_info">${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message }</div>
				<div class="login_info2"></div>
			</div>
			<div class="login_middleright"></div>
			<div class="clear"></div>
		</div>
		<div class="login_bottom">
			<div class="login_copyright"></div>
		</div>
	</div>
	<script type="text/javascript">
		$(function(){
			//居中
			 $('.login_main').center();
			 $("#username").focus();
			 $("#username").keydown(function(event){
			 	if(event.keyCode==13){login();}
			 });
			 $("#password").keydown(function(event){
			 	if(event.keyCode==13){login();}
			 });
			 $("#validCode").keydown(function(event){
			 	if(event.keyCode==13){login();}
			 });
		})
		//登录
		function login() {
			$(".login_info").html("正在登录中......");
			//登录处理
			$("#loginForm").submit();
		}
	</script>
  </body>
</html>
